package com.cong.security.mapper;

import com.cong.security.entity.Account;
import org.apache.ibatis.annotations.Select;

public interface AccountMapper {
    int insert(Account account);

    /**
     * @return com.cong.security.entity.Account
     * @Description 用户名密码登录
     * @Param [phone] 手机号
     * @Author single-聪
     * @Date 18:45 2020/1/7
     * @Version 1.0.1
     **/
    Account loginByPhone(String phone);

    Account loginById(String id);

    /**
     * 判断用户是否已经存在在系统中
     *
     * @param userName
     *            用户名(手机号)
     * @return 数量
     */
    @Select("select count(id) from account where user_name=#{userName,jdbcType=VARCHAR} and state = 'A'")
    Integer exist(String userName);
}